﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ASP.NETWebFormTutorial
{
    public partial class WebForm1 : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            timeDiv.InnerText = DateTime.Now.ToLongTimeString();

            Trace.TraceFinished += Trace_TraceFinished;
        }

        void Trace_TraceFinished(object sender, TraceContextEventArgs e)
        {
            foreach (TraceContextRecord traceContextRecord in e.TraceRecords)
            {
                //System.Diagnostics.Debug.WriteLine(traceContextRecord.Message);
                System.Diagnostics.Trace.WriteLine(traceContextRecord.Message);
            }
        }



        protected void Button1_Click(object sender, EventArgs e)
        {
            Trace.Warn("Button_Click", "Add key to session");
            this.Session["TableEntries"] = "sessionDemo";

        }
    }
}